package com.tomato.bean;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Blob;



@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Ebook {
	/* id */
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	/* title */
	@Persistent
	private String title;

	/* description */
	@Persistent
	private String description;

	/* upload date */
	@Persistent
	private Date date;
	
	/* book image */
	@Persistent
	private Blob image;
	
	/* ebook */
	@Persistent
	private Blob ebook;
	
	/* author */
	@Persistent
	private int count;
	
	/* genre */
	@Persistent
	private String genre;
	
	/* count */
	@Persistent
	private String author;

	/* constructor */
	public Ebook(Long id, Blob image) {
		this.id = id;
		this.image = image;
	}
	public Ebook(String title, String author, String genre, String description, Date date, Blob ebook) {
		this.title = title;
		this.author = author;
		this.genre = genre;
		this.description = description;
		this.date = date;
		this.ebook = ebook;
	}
	public Ebook(Long id, int count) {
		this.id = id;
		this.count = count;
	}
	
	//getter setter
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Blob getImage() {
		return image;
	}
	public void setImage(Blob image) {
		this.image = image;
	}
	public Blob getEbook() {
		return ebook;
	}
	public void setEbook(Blob ebook) {
		this.ebook = ebook;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public String getGenre() {
		return genre;
	}
	public void setGenre(String genre) {
		this.genre = genre;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
}
